exports = this
exports.CPANEL.Grids = exports.CPANEL.Grids || {}

class exports.CPANEL.Grids.DataTable
  @init: ->
    $("#grids_datatable").DataTable
        pageLength: 25
        bProcessing: true
        bServerSide: true
        stateSave: true
        responsive: true
        sAjaxSource: $("#grids_datatable").data('source')
        language: CPANEL.datatableLanguage
        order: [[2, 'desc']]
        columnDefs: [
          { orderable: false, targets: 0 }
          { orderable: false, targets: 3 }
        ]
  @refresh: ->
    $("#grids_datatable").DataTable().ajax.reload();
